package com.vegetable.modules.entity.baseData;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 产地商品
 * </p>
 *
 * @author wangruijie
 * @since 2024-03-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Products对象", description="产地商品")
public class Products implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;


    @ApiModelProperty(value = "标准品名")
    private String standardName;

    @ApiModelProperty(value = "习惯称谓")
    private String commonName;

    @ApiModelProperty(value = "商品编码")
    private String commonCode;

    @ApiModelProperty(value = "轻质")
    private Integer tags;

    @ApiModelProperty(value = "商品分类")
    private String category;

    @ApiModelProperty(value = "商品分类ID")
    @TableField("category_id")
    private Long categoryId;

    @ApiModelProperty(value = "标准重量")
    private BigDecimal standardWeight;

    @ApiModelProperty(value = "毛重")
    private BigDecimal grossWeight;

    @ApiModelProperty(value = "固定损耗")
    private BigDecimal weightAdd;

    @ApiModelProperty(value = "体积")
    private BigDecimal volume;

    @ApiModelProperty(value = "单价")
    private BigDecimal unitPrice;

    @ApiModelProperty(value = "产地")
    private String placeOrigin;
    @ApiModelProperty(value = "产地Id")
    private Long areaId;

    @ApiModelProperty(value = "规格ID")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(exist = false)
    private Long specsId;

    @ApiModelProperty(value = "规格名称")
    @TableField(exist = false)
    private String specsName;

    @ApiModelProperty(value = "创建者ID")
    private Long createUserId;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date createTime;

    @ApiModelProperty(value = "是否启用：0是1否")
    private Integer isEnabled;

    @ApiModelProperty(value = "报价单Id")
    private Long quotationId;

    @ApiModelProperty(value = "报价单商品")
    private String quotationName;

    @ApiModelProperty(value = "台账标识 0寿光 1河北")
    private Integer regionId;

    @ApiModelProperty(value = "是否需要自己加工 0是 1否")
    private Integer selfProcessing;
    
    @ApiModelProperty(value = "商品图片链接")
    private String imageUrl;
}